#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# @Project:     uninlu_serv
# @File:        main.py
# @Author:      Fan GuiChuan
# @Date:        2025/05/27 8:42
# @Version:     Python3.8
# @Description:
import sys
sys.path.append('..')

from src.app import app
from flask_cors import CORS
from src.utils.u_config_ini import IniConfigManager

CORS(app, supports_credentials=True)


if __name__ == '__main__':
    server_cfg = IniConfigManager.get_section_config('server')
    app_debug = int(server_cfg.get('debug', False))
    app_host = server_cfg.get('host', '0.0.0.0')
    app_port = int(server_cfg.get('port', 50000))
    app.debug = app_debug
    app.run(host=app_host,
            port=app_port)
